Non-volatile memories are commonly used in several applications when the data stored in the memory need to be preserved even in absence of power supply. Within the class of non-volatile memories, electrically programmable (and erasable) memories, such as flash memories, have become very popular in applications in which the data to be stored are not immutable (as it might be case of, e.g., a consolidated code for a microprocessor), being instead necessary from time to time to store new data, or to update the data already stored. Examples of such applications include memory cards of the type used for example in digital cameras.
Typically, the memory includes an arrangement of memory cells, disposed for example in rows and columns, so as to form a matrix. Depending on the way the memory cells in the matrix are interconnected, a so-called NAND architecture for the flash memories can be identified. Roughly speaking, in a NAND architecture, groups of memory cells of a same matrix column are serially interconnected so as to form respective strings, which strings are then connected in parallel to each other to a same bit line. NAND flash memories are compact (a low number of contacts in the matrix are required), and they are suited for applications such as file storage.
In the NAND architecture, the memory space is ideally partitioned into a plurality of memory pages, each page corresponding to a group of memory cells that, in operation, are read or written simultaneously, i.e. in parallel to each other. The number of memory cells in each group determines the size (i.e., the number of bits) of the memory page. Nowadays, memory pages of 512 Bytes are rather typical, but larger memory pages are also encountered, for example of 2 KBytes.
The memory space is further logically partitioned into a plurality of memory blocks or sectors, each memory block including a plurality of memory pages that, in operation, are erased simultaneously.
Before shipping, each NAND memory undergoes a testing phase in which some invalid memory blocks, i.e. containing invalid data bits not repairable, can be found. The invalid memory blocks (in jargon, referred to as “bad” blocks) are “marked” before utilization by programming a number of memory cells inside each bad block with a predetermined string of bits.
In addition, during the lifetime of the NAND memories (typically, of about ten years), a percentage of the initially valid memory blocks can become invalid after having endured cycles of erase or write operations (typically, the manufactures guarantee that at most 2% of the total number of the memory blocks may become bad during the expected lifetime).
Because the bad blocks are randomly scattered throughout the NAND memories, it is often necessary to map them so that they are not used, i.e. not addressed in either read or program.
In solutions known in the art, an external device that performs operations on the NAND memory, such as a microprocessor or a microcontroller, preliminarily scans the NAND memory for locating the bad blocks. The external device creates, stores, and manages a mapping, in terms of the memory addresses, of the NAND memory particularly of the bad blocks, using for example an additional non-volatile memory external to the NAND memory. Typically, the external memory is a Content Addressable Memory, and before any operation, the external device compares the memory address to be provided to the NAND memory with the mapping stored in the CAM; then, the external device discards and substitutes invalid memory addresses.
As a consequence, the managing of the operations to be performed on the NAND memory is greatly complicated, mainly because the managing of the bad blocks internal to the NAND memory is not transparent to the external user.
Furthermore, it has to be considered that finding bad blocks in a NAND memory implies an inevitable reduction of its storage capability, which contrasts with the increasing request for memories with greater and greater sizes.